<template>
  <el-form class="form" label-width="160px" size="small">
    <el-row>
      <el-col :span="10" :offset="7">
        <el-form-item label="当前用户">
          <div class="text">{{ $store.getters['user/accountInfo'].phone }}</div>
        </el-form-item>
        <el-form-item label="认证状态">
          <div
            class="text"
            :class="[
              data.status == 0
                ? 'failure'
                : data.status == 1
                ? 'success'
                : data.status == 2
                ? 'failure'
                : data.status == 3
                ? 'error'
                : data.status == 4
                ? 'import'
                : ''
            ]"
          >
            {{ status_text }}
          </div>
        </el-form-item>
        <el-form-item label="机构名称">
          <div class="text">{{ data.title }}</div>
        </el-form-item>
        <el-form-item label="机构所属分类(行业)">
          <span class="text" v-for="(item, index) in data.selected_category" :key="index">{{
            item.text
          }}</span>
        </el-form-item>
        <el-form-item label="LOGO">
          <edu-image class="preview" :src="data.logo_url" :preview-src-list="srcList"></edu-image>
        </el-form-item>
        <el-form-item label="机构简介">
          <div class="text">{{ data.intro }}</div>
        </el-form-item>
        <el-form-item label="联系电话">
          <div class="text">{{ data.telephone }}</div>
        </el-form-item>
        <el-form-item label="联系地址">
          <div class="text">{{ data.address }}</div>
        </el-form-item>
        <el-form-item label="法人身份证号">
          <div class="text">{{ data.legal_IDcard }}</div>
        </el-form-item>
        <el-form-item label="身份证正面">
          <edu-image
            class="preview"
            :src="data.legal_IDcard_positive_url"
            :preview-src-list="srcList"
          ></edu-image>
        </el-form-item>
        <el-form-item label="身份证反面">
          <edu-image
            class="preview"
            :src="data.legal_IDcard_side_url"
            :preview-src-list="srcList"
          ></edu-image>
        </el-form-item>
        <el-form-item label="营业执照">
          <edu-image
            class="preview"
            :src="data.business_license_url"
            :preview-src-list="srcList"
          ></edu-image>
        </el-form-item>
      </el-col>
    </el-row>
    <template v-if="data.status == 3">
      <el-divider></el-divider>
      <el-row type="flex" justify="center">
        <el-button class="btn" size="small" type="primary" @click="next()">重新提交</el-button>
      </el-row>
    </template>
  </el-form>
</template>

<script>
export default {
  props: ['data', 'status_text'],
  data() {
    return {}
  },
  computed: {
    srcList() {
      return [
        this.data.logo_url,
        this.data.legal_IDcard_positive_url,
        this.data.legal_IDcard_side_url,
        this.data.business_license_url
      ]
    }
  },
  methods: {
    next() {
      this.$emit('again', 5)
    }
  }
}
</script>

<style lang="scss" scoped>
.form {
  background-color: #fff;
  padding: 30px 0;
  ::v-deep .el-form-item__label {
    font-size: 12px;
  }
  ::v-deep .el-icon-circle-close {
    color: #fff;
  }
  .text {
    font-size: 13px;
  }
  .import {
    color: $text-color-import;
  }
  .error {
    color: $text-color-error;
  }
  .failure {
    color: $text-color-auxiliary;
  }
  .success {
    color: $color-success;
  }
  .preview {
    width: 100px;
    height: 100px;
    display: block;
    margin-top: 10px;
  }
}
</style>
